package blog;

import blog.beans.User;
import blog.model.UserHelper;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author johdah <info@johandahlberg.com>
 */
@ManagedBean
@SessionScoped
public class UserController {
    UserHelper helper;
    
    public UserController() {
        helper = new UserHelper();
    }

    public List<User> getUsers() {
        return helper.getUsers();
    }
    
    public User getUserByUsername(String username) {
        return helper.getUserByUsername(username);
    }
    
    public User getUserById(Integer id) {
        return helper.getUserById(id);
    }
    
    public boolean isUser(String username) {
        return helper.isUser(username);
    }
    
    public boolean isUser(String username, String password) {
        return helper.isUser(username, password);
    }
    
    public boolean setUser(User user) {
        return helper.setUser(user);
    }
}